package top.v5it.japi.plus.common;

import cn.hutool.core.util.StrUtil;

/**
 * 常量
 *
 * @author zhanpu
 * @date 2021/3/23
 */
public interface ConstantCommon {

    String COLON = StrUtil.COLON;

    /**
     * 渠道编号名称
     */
    String CHANNEL_NAME = "channel";

    /**
     * 服务证书缓存key后缀
     */
    String POSTFIX_HASH_KEY_SERVER_CERT = "server_cert";

    /**
     * 平台证书加载时分布式锁后缀名
     */
    String POSTFIX_HASH_KEY_SHARDLOCK_CERT = "shardlock" + COLON + POSTFIX_HASH_KEY_SERVER_CERT;

    /**
     * 渠道编号缓存key后缀
     */
    String POSTFIX_HASH_KEY_CHANNEL = "channel";

    /**
     * 带密钥的渠道编号缓存key后缀
     */
    String POSTFIX_HASH_KEY_KEY_CHANNEL = "key_" + POSTFIX_HASH_KEY_CHANNEL;

    /**
     * 渠道编号加载时分布式锁后缀名
     */
    String POSTFIX_HASH_KEY_SHARDLOCK_CHANNEL = "shardlock" + COLON + POSTFIX_HASH_KEY_CHANNEL;

    /**
     * 带密钥的渠道编号加载时分布式锁后缀名
     */
    String POSTFIX_HASH_KEY_SHARDLOCK_KEY_CHANNEL = "shardlock" + COLON + POSTFIX_HASH_KEY_KEY_CHANNEL;

    /**
     * 接入客户端证书缓存key后缀
     */
    String POSTFIX_HASH_KEY_CLIENT_CERT = "client_cert";

    /**
     * 客户端证书加载时分布式锁后缀名
     */
    String POSTFIX_HASH_KEY_SHARDLOCK_CLIENT_CERT = "shardlock" + COLON + POSTFIX_HASH_KEY_CLIENT_CERT;

    /**
     * 接入渠道与场所编号缓存key后缀
     */
    String POSTFIX_HASH_KEY_SITE_CHANNEL = "site_channel";

    /**
     * 接入渠道与场所加载时分布式锁后缀名
     */
    String POSTFIX_HASH_KEY_SHARDLOCK_SITE_CHANNEL = "shardlock" + COLON + POSTFIX_HASH_KEY_SITE_CHANNEL;

    /**
     * 请求头id
     */
    String HEAD_REQUEST_ID_NAME = "Request-ID";

    /**
     * 日志分隔线
     */
    String LOG_DIVIDING_LINE = "\n++++++++++++++++++++++++++++++++++++++++++++++++++\n";

    String HEAD_TRACE_ID_NAME = "X-Trace-ID";
    String HEAD_SPAN_ID_NAME = "X-Span-ID";
    String SLF4J_TRACE_ID_NAME = "X-TraceId";
    String SLF4J_SPAN_ID_NAME = "X-SpanId";
    String SLF4J_IP_NAME = "ip";
    String ROOT_SPAN_ID = "0";
    String SERVER_NAME = "server.name";

}
